import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { Col, Form, Input, Row } from 'antd';

const FormItem = Form.Item;
const formItemLayout = {
	// 抽屉里面Form。二列的布局比例
	labelCol: {
		span: 6
	},
	wrapperCol: {
		span: 18
	}
};

class ProductionForm extends PureComponent {
	constructor(props) {
		super(props);
		this.state = {
			routeList: []
		};
	}
	render() {
		const {
			formData,
			form: { getFieldDecorator }
		} = this.props;
		return (
			<Form>
				<Row>
					<Col span={12}>
						<FormItem {...formItemLayout} label={'参数'}>
							{getFieldDecorator('ecnCode', {
								initialValue: formData.ecnCode || '',
								rules: [
									{
										required: true,
										message: ''
									}
								],
								getValueFromEvent: (event) => {
									return event.target.value.replace(/\s+/g, "")
								},
							})(<Input />)}
						</FormItem>
					</Col>
					<Col span={12}>
						<FormItem {...formItemLayout} label={'参数'}>
							{getFieldDecorator('ecnCode', {
								initialValue: formData.ecnCode || '',
								rules: [
									{
										required: true,
										message: ''
									}
								],
								getValueFromEvent: (event) => {
									return event.target.value.replace(/\s+/g, "")
								},
							})(<Input />)}
						</FormItem>
					</Col>
					<Col span={12}>
						<FormItem {...formItemLayout} label={'参数'}>
							{getFieldDecorator('ecnCode', {
								initialValue: formData.ecnCode || '',
								rules: [
									{
										required: true,
										message: ''
									}
								],
								getValueFromEvent: (event) => {
									return event.target.value.replace(/\s+/g, "")
								},
							})(<Input />)}
						</FormItem>
					</Col>
					<Col span={12}>
						<FormItem {...formItemLayout} label={'参数'}>
							{getFieldDecorator('ecnCode', {
								initialValue: formData.ecnCode || '',
								rules: [
									{
										required: true,
										message: ''
									}
								],
								getValueFromEvent: (event) => {
									return event.target.value.replace(/\s+/g, "")
								},
							})(<Input />)}
						</FormItem>
					</Col>
					<Col span={12}>
						<FormItem {...formItemLayout} label={'参数'}>
							{getFieldDecorator('ecnCode', {
								initialValue: formData.ecnCode || '',
								rules: [
									{
										required: true,
										message: ''
									}
								],
								getValueFromEvent: (event) => {
									return event.target.value.replace(/\s+/g, "")
								},
							})(<Input />)}
						</FormItem>
					</Col>
					<Col span={12}>
						<FormItem {...formItemLayout} label={'参数'}>
							{getFieldDecorator('ecnCode', {
								initialValue: formData.ecnCode || '',
								rules: [
									{
										required: true,
										message: ''
									}
								],
								getValueFromEvent: (event) => {
									return event.target.value.replace(/\s+/g, "")
								},
							})(<Input />)}
						</FormItem>
					</Col>
					<Col span={12}>
						<FormItem {...formItemLayout} label={'参数'}>
							{getFieldDecorator('ecnCode', {
								initialValue: formData.ecnCode || '',
								rules: [
									{
										required: true,
										message: ''
									}
								],
								getValueFromEvent: (event) => {
									return event.target.value.replace(/\s+/g, "")
								},
							})(<Input />)}
						</FormItem>
					</Col>
					<Col span={12}>
						<FormItem {...formItemLayout} label={'参数'}>
							{getFieldDecorator('ecnCode', {
								initialValue: formData.ecnCode || '',
								rules: [
									{
										required: true,
										message: ''
									}
								],
								getValueFromEvent: (event) => {
									return event.target.value.replace(/\s+/g, "")
								},
							})(<Input />)}
						</FormItem>
					</Col>
					<Col span={12}>
						<FormItem {...formItemLayout} label={'参数'}>
							{getFieldDecorator('ecnCode', {
								initialValue: formData.ecnCode || '',
								rules: [
									{
										required: true,
										message: ''
									}
								],
								getValueFromEvent: (event) => {
									return event.target.value.replace(/\s+/g, "")
								},
							})(<Input />)}
						</FormItem>
					</Col>
					<Col span={12}>
						<FormItem {...formItemLayout} label={'参数'}>
							{getFieldDecorator('ecnCode', {
								initialValue: formData.ecnCode || '',
								rules: [
									{
										required: true,
										message: ''
									}
								],
								getValueFromEvent: (event) => {
									return event.target.value.replace(/\s+/g, "")
								},
							})(<Input />)}
						</FormItem>
					</Col>
					<Col span={12}>
						<FormItem {...formItemLayout} label={'参数'}>
							{getFieldDecorator('ecnCode', {
								initialValue: formData.ecnCode || '',
								rules: [
									{
										required: true,
										message: ''
									}
								],
								getValueFromEvent: (event) => {
									return event.target.value.replace(/\s+/g, "")
								},
							})(<Input />)}
						</FormItem>
					</Col>
					<Col span={12}>
						<FormItem {...formItemLayout} label={'参数'}>
							{getFieldDecorator('ecnCode', {
								initialValue: formData.ecnCode || '',
								rules: [
									{
										required: true,
										message: ''
									}
								],
								getValueFromEvent: (event) => {
									return event.target.value.replace(/\s+/g, "")
								},
							})(<Input />)}
						</FormItem>
					</Col>


				</Row>
			</Form>
		);
	}
}

ProductionForm.propTypes = {
	isChinese: PropTypes.bool,
	locale: PropTypes.string,
	formData: PropTypes.object,
	form: PropTypes.object,
	columns: PropTypes.array,
	roles: PropTypes.array,
	onOk: PropTypes.func,
	onClose: PropTypes.func,
	customerList: PropTypes.array,
	productList: PropTypes.array,
};

export default Form.create()(ProductionForm);
